<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [1,3,5,67,7,5,3,5];
        // 判断数组是否存在某个元素 如果存在返回第一个找到的元素的下标,不存在返回-1
        console.log(arr.indexOf(5));
        console.log(arr.lastIndexOf(5));
        // 没检索到即返回-1
    </script>
</body>
</html>